﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using VM.Entity.EntityDto.Menu;
using VM.Entity.EntityMap.Goods;
using VM.Entity.EntityMap.Order;
using VM.Entity.EntityMap.User;

namespace VM.Entity.EntityDto.Order
{
    /// <summary>
    /// 获取订单主要信息
    /// </summary>
    public class getOrderMainInfoDto
    {
        #region Model
        private int? _id;
        private string _name;
        private int? _status;
        private int _goodid;
        private int _specid;
        private int _qty;
        private int _createuserid;
        private DateTime _createdate;
        private int _updateuserid;
        private DateTime _updatedate;
        private decimal _price;
        private decimal _amount;
        private string _description;
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, IsOnlyIgnoreInsert = true)]
        public int? id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 
        /// </summary>
        [JsonIgnore]
        public string? name
        {
            set { _name = value; }
            get { return _name; }
        }
        /// <summary>
        /// 状态
        /// </summary>
        [JsonIgnore]
        public int? status
        {
            set { _status = value; }
            get { return _status; }
        }
        /// <summary>
        /// 商品内码
        /// </summary>
        public int goodId
        {
            set { _goodid = value; }
            get { return _goodid; }
        }

        //[Navigate(NavigateType.OneToOne, nameof(goodId))]
        //[SugarColumn(IsOnlyIgnoreInsert = true)]
        //[JsonIgnore]
        //public good_mainInfo? good { get; set; }
        /// <summary>
        /// 规格型号内码
        /// </summary>
        public int specId
        {
            set { _specid = value; }
            get { return _specid; }
        }

        //[Navigate(NavigateType.OneToOne, nameof(specId))]
        //[SugarColumn(IsOnlyIgnoreInsert = true)]
        //[JsonIgnore]
        //public good_spec? spec { get; set; }

        /// <summary>
        /// 订单数量
        /// </summary>
        public int qty
        {
            set { _qty = value; }
            get { return _qty; }
        }

        //[Navigate(NavigateType.OneToOne, nameof(createUserId))]
        //[SugarColumn(IsOnlyIgnoreInsert = true)]
        //[JsonIgnore]
        //public sys_user? createUser { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        //[JsonIgnore]
        //public int createUserId
        //{
        //    set { _createuserid = value; }
        //    get { return _createuserid; }
        //}
        /// <summary>
        /// 创建时间
        /// </summary>
        //[JsonIgnore]
        //public DateTime createDate
        //{
        //    set { _createdate = value; }
        //    get { return _createdate; }
        //}

        //[Navigate(NavigateType.OneToOne, nameof(updateUserId))]
        //[SugarColumn(IsOnlyIgnoreInsert = true)]
        //[JsonIgnore]
        //public sys_user? updateUser { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        //[JsonIgnore]
        //public int updateUserId
        //{
        //    set { _updateuserid = value; }
        //    get { return _updateuserid; }
        //}
        /// <summary>
        /// 更新时间
        /// </summary>
        //[JsonIgnore]
        //public DateTime updateDate
        //{
        //    set { _updatedate = value; }
        //    get { return _updatedate; }
        //}
        /// <summary>
        /// 单价
        /// </summary>
        //public decimal price
        //{
        //    set { _price = value; }
        //    get { return _price; }
        //}
        /// <summary>
        /// 金额，这个需要金额，不能自动计算，考虑到后期会有改价的情况
        /// </summary>
        public decimal amount
        {
            set { _amount = value; }
            get { return _amount; }
        }
        ///// <summary>
        ///// 备注
        ///// </summary>
        //public string description
        //{
        //    set { _description = value; }
        //    get { return _description; }
        //}

        /// <summary>
        /// 订单编号
        /// </summary>
        [JsonIgnore]
        public string? OrderNo { get; set; }


        //[Navigate(NavigateType.OneToMany, nameof(id), nameof(sys_orderPeople.parentId))]
        //[ForeignKey("parentId")]
        //public List<sys_orderPeople>? orderPeople { get; set; }
        #endregion Model

    }
}
